package com.example.demo;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletRegistrationBean;
import org.springframework.context.annotation.Bean;

import com.example.demo.servlet.SecondServlet;

@SpringBootApplication
public class SpringbootServlet2Application {

	public static void main(String[] args) {
		SpringApplication.run(SpringbootServlet2Application.class, args);
	}
	@Bean
	public static ServletRegistrationBean<SecondServlet> getServlet(){
		ServletRegistrationBean<SecondServlet> secondServlet = new ServletRegistrationBean<>(new SecondServlet());
		secondServlet.addUrlMappings("/second");
		return secondServlet;
	}
}
